Results 1 to 2 of 2

Thread: QIODevice::write: device not open” when file is open

  1. #1
    Join Date
    Oct 2016
    Posts
    61
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default QIODevice::write: device not open” when file is open

    hi if i am using some file and it's openned. I can't write there? This error can crash my program? or it's only one alert? thx again!

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QIODevice::write: device not open” when file is open

    If you open a file read-only you cannot write. If you open file for write in a location that can be removed then you might be able to write for a while and then fail. ..Or writing might totally hang your application... There are many variations and you have provided no information.

    If they cannot write a simple file then Qt IO functions generally fail to write and return, outputting a warning to the console/debug stream. It would be very poor form to fail to rely on this instead of programming to do something known and controlled if writing fails.

Similar Threads

  1. QIODevice::open: File access not specified
    By Clausen in forum Newbie
    Replies: 2
    Last Post: 19th April 2015, 19:58
  2. Replies: 2
    Last Post: 14th January 2013, 07:07
  3. Replies: 2
    Last Post: 30th June 2010, 10:48
  4. How to open a file in Read Write mode
    By merry in forum Qt Programming
    Replies: 13
    Last Post: 16th November 2007, 14:40
  5. open/write gzipped file
    By niko in forum Newbie
    Replies: 10
    Last Post: 12th December 2006, 19:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.